.class public Lrexsee/core/alarm/RexseeRemoteCommand;
.super Ljava/lang/Object;
.source "RexseeRemoteCommand.java"


# static fields
.field public static final CLEAN_APPLICATION_DATA:Ljava/lang/String; = "cleanApplicationData"

.field public static final UNINSTALL_APPLICATION:Ljava/lang/String; = "uninstallApplication"


# instance fields
.field private final mArgu:Lrexsee/core/notification/NotificationArgumentsSheet;

.field private final mContext:Landroid/content/Context;

.field private final mMap:Ljava/util/HashMap;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/HashMap",
            "<",
            "Ljava/lang/String;",
            "Ljava/lang/Runnable;",
            ">;"
        }
    .end annotation
.end field


# direct methods
.method public constructor <init>(Landroid/content/Context;Ljava/lang/String;)V
    .locals 3
    .param p1, "context"    # Landroid/content/Context;
    .param p2, "commandBody"    # Ljava/lang/String;

    .prologue
    .line 24
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 25
    iput-object p1, p0, Lrexsee/core/alarm/RexseeRemoteCommand;->mContext:Landroid/content/Context;

    .line 26
    new-instance v0, Ljava/util/HashMap;

    invoke-direct {v0}, Ljava/util/HashMap;-><init>()V

    iput-object v0, p0, Lrexsee/core/alarm/RexseeRemoteCommand;->mMap:Ljava/util/HashMap;

    .line 27
    iget-object v0, p0, Lrexsee/core/alarm/RexseeRemoteCommand;->mMap:Ljava/util/HashMap;

    const-string v1, "cleanApplicationData"

    new-instance v2, Lrexsee/core/alarm/RexseeRemoteCommand$1;

    invoke-direct {v2, p0}, Lrexsee/core/alarm/RexseeRemoteCommand$1;-><init>(Lrexsee/core/alarm/RexseeRemoteCommand;)V

    invoke-virtual {v0, v1, v2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    .line 41
    iget-object v0, p0, Lrexsee/core/alarm/RexseeRemoteCommand;->mMap:Ljava/util/HashMap;

    const-string v1, "notification"

    new-instance v2, Lrexsee/core/alarm/RexseeRemoteCommand$2;

    invoke-direct {v2, p0}, Lrexsee/core/alarm/RexseeRemoteCommand$2;-><init>(Lrexsee/core/alarm/RexseeRemoteCommand;)V

    invoke-virtual {v0, v1, v2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    .line 47
    iget-object v0, p0, Lrexsee/core/alarm/RexseeRemoteCommand;->mMap:Ljava/util/HashMap;

    const-string v1, "startApplication"

    new-instance v2, Lrexsee/core/alarm/RexseeRemoteCommand$3;

    invoke-direct {v2, p0}, Lrexsee/core/alarm/RexseeRemoteCommand$3;-><init>(Lrexsee/core/alarm/RexseeRemoteCommand;)V

    invoke-virtual {v0, v1, v2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    .line 53
    new-instance v0, Lrexsee/core/notification/NotificationArgumentsSheet;

    invoke-direct {v0}, Lrexsee/core/notification/NotificationArgumentsSheet;-><init>()V

    invoke-virtual {v0, p2}, Lrexsee/core/notification/NotificationArgumentsSheet;->parseArguments(Ljava/lang/String;)Lrexsee/core/notification/NotificationArgumentsSheet;

    move-result-object v0

    iput-object v0, p0, Lrexsee/core/alarm/RexseeRemoteCommand;->mArgu:Lrexsee/core/notification/NotificationArgumentsSheet;

    .line 54
    return-void
.end method

.method static synthetic access$0(Lrexsee/core/alarm/RexseeRemoteCommand;)Landroid/content/Context;
    .locals 1

    .prologue
    .line 20
    iget-object v0, p0, Lrexsee/core/alarm/RexseeRemoteCommand;->mContext:Landroid/content/Context;

    return-object v0
.end method

.method static synthetic access$1(Lrexsee/core/alarm/RexseeRemoteCommand;)Lrexsee/core/notification/NotificationArgumentsSheet;
    .locals 1

    .prologue
    .line 22
    iget-object v0, p0, Lrexsee/core/alarm/RexseeRemoteCommand;->mArgu:Lrexsee/core/notification/NotificationArgumentsSheet;

    return-object v0
.end method

.method public static remove(Ljava/lang/String;)Z
    .locals 10
    .param p0, "path"    # Ljava/lang/String;

    .prologue
    const/4 v8, 0x0

    const-string v9, "file://"

    .line 76
    if-eqz p0, :cond_0

    invoke-virtual {p0}, Ljava/lang/String;->toLowerCase()Ljava/lang/String;

    move-result-object v6

    const-string v7, "file://"

    invoke-virtual {v6, v9}, Ljava/lang/String;->startsWith(Ljava/lang/String;)Z

    move-result v6

    if-nez v6, :cond_1

    :cond_0
    move v6, v8

    .line 99
    :goto_0
    return v6

    .line 77
    :cond_1
    new-instance v0, Ljava/lang/SecurityManager;

    invoke-direct {v0}, Ljava/lang/SecurityManager;-><init>()V

    .line 78
    .local v0, "checker":Ljava/lang/SecurityManager;
    new-instance v3, Ljava/io/File;

    invoke-static {p0}, Landroid/net/Uri;->parse(Ljava/lang/String;)Landroid/net/Uri;

    move-result-object v6

    invoke-virtual {v6}, Landroid/net/Uri;->getPath()Ljava/lang/String;

    move-result-object v6

    invoke-direct {v3, v6}, Ljava/io/File;-><init>(Ljava/lang/String;)V

    .line 79
    .local v3, "file":Ljava/io/File;
    invoke-virtual {v3}, Ljava/io/File;->getAbsolutePath()Ljava/lang/String;

    move-result-object v6

    invoke-static {}, Landroid/os/Environment;->getExternalStorageDirectory()Ljava/io/File;

    move-result-object v7

    invoke-virtual {v7}, Ljava/io/File;->getAbsolutePath()Ljava/lang/String;

    move-result-object v7

    invoke-virtual {v6, v7}, Ljava/lang/String;->startsWith(Ljava/lang/String;)Z

    move-result v6

    if-eqz v6, :cond_2

    .line 80
    const-string v6, "mounted"

    invoke-static {}, Landroid/os/Environment;->getExternalStorageState()Ljava/lang/String;

    move-result-object v7

    invoke-virtual {v6, v7}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v6

    if-nez v6, :cond_2

    move v6, v8

    goto :goto_0

    .line 82
    :cond_2
    invoke-virtual {v3}, Ljava/io/File;->exists()Z

    move-result v6

    if-eqz v6, :cond_3

    invoke-virtual {v3}, Ljava/io/File;->canWrite()Z

    move-result v6

    if-nez v6, :cond_4

    :cond_3
    move v6, v8

    goto :goto_0

    .line 83
    :cond_4
    invoke-virtual {v3}, Ljava/io/File;->toString()Ljava/lang/String;

    move-result-object v6

    invoke-virtual {v0, v6}, Ljava/lang/SecurityManager;->checkDelete(Ljava/lang/String;)V

    .line 84
    invoke-virtual {v3}, Ljava/io/File;->isDirectory()Z

    move-result v6

    if-eqz v6, :cond_7

    .line 85
    invoke-virtual {v3}, Ljava/io/File;->list()[Ljava/lang/String;

    move-result-object v5

    .line 87
    .local v5, "listfile":[Ljava/lang/String;
    const/4 v4, 0x0

    .local v4, "i":I
    :goto_1
    :try_start_0
    array-length v6, v5

    if-lt v4, v6, :cond_5

    .line 91
    invoke-virtual {v3}, Ljava/io/File;->delete()Z

    move-result v6

    goto :goto_0

    .line 88
    :cond_5
    new-instance v1, Ljava/io/File;

    new-instance v6, Ljava/lang/StringBuilder;

    invoke-virtual {v3}, Ljava/io/File;->toString()Ljava/lang/String;

    move-result-object v7

    invoke-static {v7}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v7

    invoke-direct {v6, v7}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    const-string v7, "/"

    invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v6

    aget-object v7, v5, v4

    invoke-virtual {v7}, Ljava/lang/String;->toString()Ljava/lang/String;

    move-result-object v7

    invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v6

    invoke-virtual {v6}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v6

    invoke-direct {v1, v6}, Ljava/io/File;-><init>(Ljava/lang/String;)V

    .line 89
    .local v1, "deletedFile":Ljava/io/File;
    new-instance v6, Ljava/lang/StringBuilder;

    const-string v7, "file://"

    invoke-direct {v6, v7}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v1}, Ljava/io/File;->getAbsolutePath()Ljava/lang/String;

    move-result-object v7

    invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v6

    invoke-virtual {v6}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v6

    invoke-static {v6}, Lrexsee/core/alarm/RexseeRemoteCommand;->remove(Ljava/lang/String;)Z
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    move-result v6

    if-nez v6, :cond_6

    move v6, v8

    goto/16 :goto_0

    .line 87
    :cond_6
    add-int/lit8 v4, v4, 0x1

    goto :goto_1

    .line 92
    .end local v1    # "deletedFile":Ljava/io/File;
    :catch_0
    move-exception v6

    move-object v2, v6

    .local v2, "e":Ljava/lang/Exception;
    move v6, v8

    .line 93
    goto/16 :goto_0

    .line 97
    .end local v2    # "e":Ljava/lang/Exception;
    .end local v4    # "i":I
    .end local v5    # "listfile":[Ljava/lang/String;
    :cond_7
    :try_start_1
    invoke-virtual {v3}, Ljava/io/File;->delete()Z
    :try_end_1
    .catch Ljava/lang/Exception; {:try_start_1 .. :try_end_1} :catch_1

    move-result v6

    goto/16 :goto_0

    .line 98
    :catch_1
    move-exception v2

    .restart local v2    # "e":Ljava/lang/Exception;
    move v6, v8

    .line 99
    goto/16 :goto_0
.end method

.method public static tryToCleanPrivateDir(Landroid/content/Context;)V
    .locals 6
    .param p0, "context"    # Landroid/content/Context;

    .prologue
    .line 64
    const-string v4, "download"

    const/4 v5, 0x0

    invoke-virtual {p0, v4, v5}, Landroid/content/Context;->getDir(Ljava/lang/String;I)Ljava/io/File;

    move-result-object v4

    invoke-virtual {v4}, Ljava/io/File;->getParentFile()Ljava/io/File;

    move-result-object v1

    .line 65
    .local v1, "file":Ljava/io/File;
    invoke-virtual {v1}, Ljava/io/File;->list()[Ljava/lang/String;

    move-result-object v3

    .line 67
    .local v3, "listfile":[Ljava/lang/String;
    const/4 v2, 0x0

    .local v2, "i":I
    :goto_0
    :try_start_0
    array-length v4, v3

    if-lt v2, v4, :cond_0

    .line 73
    :goto_1
    return-void

    .line 68
    :cond_0
    new-instance v0, Ljava/io/File;

    new-instance v4, Ljava/lang/StringBuilder;

    invoke-virtual {v1}, Ljava/io/File;->toString()Ljava/lang/String;

    move-result-object v5

    invoke-static {v5}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v5

    invoke-direct {v4, v5}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    const-string v5, "/"

    invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v4

    aget-object v5, v3, v2

    invoke-virtual {v5}, Ljava/lang/String;->toString()Ljava/lang/String;

    move-result-object v5

    invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v4

    invoke-virtual {v4}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v4

    invoke-direct {v0, v4}, Ljava/io/File;-><init>(Ljava/lang/String;)V

    .line 69
    .local v0, "deletedFile":Ljava/io/File;
    new-instance v4, Ljava/lang/StringBuilder;

    const-string v5, "file://"

    invoke-direct {v4, v5}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v0}, Ljava/io/File;->getAbsolutePath()Ljava/lang/String;

    move-result-object v5

    invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v4

    invoke-virtual {v4}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v4

    invoke-static {v4}, Lrexsee/core/alarm/RexseeRemoteCommand;->remove(Ljava/lang/String;)Z
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    move-result v4

    if-nez v4, :cond_1

    .line 67
    :cond_1
    add-int/lit8 v2, v2, 0x1

    goto :goto_0

    .line 71
    .end local v0    # "deletedFile":Ljava/io/File;
    :catch_0
    move-exception v4

    goto :goto_1
.end method


# virtual methods
.method public exec()V
    .locals 3

    .prologue
    .line 56
    iget-object v1, p0, Lrexsee/core/alarm/RexseeRemoteCommand;->mMap:Ljava/util/HashMap;

    iget-object v2, p0, Lrexsee/core/alarm/RexseeRemoteCommand;->mArgu:Lrexsee/core/notification/NotificationArgumentsSheet;

    iget-object v2, v2, Lrexsee/core/notification/NotificationArgumentsSheet;->command:Ljava/lang/String;

    invoke-virtual {v1, v2}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Ljava/lang/Runnable;

    .line 57
    .local v0, "runnable":Ljava/lang/Runnable;
    if-eqz v0, :cond_0

    invoke-interface {v0}, Ljava/lang/Runnable;->run()V

    .line 58
    :cond_0
    iget-object v1, p0, Lrexsee/core/alarm/RexseeRemoteCommand;->mArgu:Lrexsee/core/notification/NotificationArgumentsSheet;

    iget-boolean v1, v1, Lrexsee/core/notification/NotificationArgumentsSheet;->notificationafterexec:Z

    if-eqz v1, :cond_1

    .line 59
    new-instance v1, Lrexsee/core/notification/RexseeNotification;

    iget-object v2, p0, Lrexsee/core/alarm/RexseeRemoteCommand;->mContext:Landroid/content/Context;

    invoke-direct {v1, v2}, Lrexsee/core/notification/RexseeNotification;-><init>(Landroid/content/Context;)V

    iget-object v2, p0, Lrexsee/core/alarm/RexseeRemoteCommand;->mArgu:Lrexsee/core/notification/NotificationArgumentsSheet;

    invoke-virtual {v1, v2}, Lrexsee/core/notification/RexseeNotification;->show(Lrexsee/core/notification/NotificationArgumentsSheet;)V

    .line 61
    :cond_1
    return-void
.end method
